import request from '@/utils/request'
import qs from 'qs'


export function getDustReportList(query) {
    return request({
        url: 'api/weixin/dustReport'+ '?' + qs.stringify(query, { indices: false }),
        method: 'get'
    })
}


// 新增用户
export function create(data) {
    return request({
        url: '/api/weixin/dustReport',
        method: 'post',
        data: data
    })
}

/**
 *  根据id获取上报信息
 * @param id
 * @returns {AxiosPromise}
 */
export function findById(id) {
    return request({
        url: 'api/weixin/dustReport/'+id,
        method: 'get'
    })
}

/**
 *
 * @param openId
 * @returns {AxiosPromise}
 */
export function findByOpenId(openId) {
    return request({
        url: 'api/weixin/dustReport/openId/'+openId,
        method: 'get'
    })
}

// 事件信息
export function updateDustReport(data) {
    return request({
        url: '/api/weixin/dustReport',
        method: 'put',
        data: data
    })
}

// 导出案件
export function exportDustReport(query) {
    return request({
        url: '/api/weixin/dustReport/export',
        method: 'get',
        params: query
    })
}
